\(\int \sinh ^3(c+d x) (a+b \tanh ^2(c+d x)) \, dx\) [2]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 47 \[ \int \sinh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=-\frac {(a+2 b) \cosh (c+d x)}{d}+\frac {(a+b) \cosh ^3(c+d x)}{3 d}-\frac {b \text {sech}(c+d x)}{d} \]

[Out]

-(a+2*b)*cosh(d*x+c)/d+1/3*(a+b)*cosh(d*x+c)^3/d-b*sech(d*x+c)/d

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3745, 459} \[ \int \sinh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {(a+b) \cosh ^3(c+d x)}{3 d}-\frac {(a+2 b) \cosh (c+d x)}{d}-\frac {b \text {sech}(c+d x)}{d} \]

[In]

Int[Sinh[c + d*x]^3*(a + b*Tanh[c + d*x]^2),x]

[Out]

-(((a + 2*b)*Cosh[c + d*x])/d) + ((a + b)*Cosh[c + d*x]^3)/(3*d) - (b*Sech[c + d*x])/d

Rule 459

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Int[ExpandI
ntegrand[(e*x)^m*(a + b*x^n)^p*(c + d*x^n)^q, x], x] /; FreeQ[{a, b, c, d, e, m, n}, x] && NeQ[b*c - a*d, 0] &
& IGtQ[p, 0] && IGtQ[q, 0]

Rule 3745

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sec[e + f*x], x]}, Dist[1/(f*ff^m), Subst[Int[(-1 + ff^2*x^2)^((m - 1)/2)*((a - b + b*ff^2*x^2)^p/x^(m
 + 1)), x], x, Sec[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {\left (-1+x^2\right ) \left (a+b-b x^2\right )}{x^4} \, dx,x,\text {sech}(c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \left (-b+\frac {-a-b}{x^4}+\frac {a+2 b}{x^2}\right ) \, dx,x,\text {sech}(c+d x)\right )}{d} \\ & = -\frac {(a+2 b) \cosh (c+d x)}{d}+\frac {(a+b) \cosh ^3(c+d x)}{3 d}-\frac {b \text {sech}(c+d x)}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.30 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.55 \[ \int \sinh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=-\frac {3 a \cosh (c+d x)}{4 d}-\frac {7 b \cosh (c+d x)}{4 d}+\frac {a \cosh (3 (c+d x))}{12 d}+\frac {b \cosh (3 (c+d x))}{12 d}-\frac {b \text {sech}(c+d x)}{d} \]

[In]

Integrate[Sinh[c + d*x]^3*(a + b*Tanh[c + d*x]^2),x]

[Out]

(-3*a*Cosh[c + d*x])/(4*d) - (7*b*Cosh[c + d*x])/(4*d) + (a*Cosh[3*(c + d*x)])/(12*d) + (b*Cosh[3*(c + d*x)])/
(12*d) - (b*Sech[c + d*x])/d

Maple [A] (verified)

Time = 0.63 (sec) , antiderivative size = 75, normalized size of antiderivative = 1.60

method result size
derivativedivides \(\frac {a \left (-\frac {2}{3}+\frac {\sinh \left (d x +c \right )^{2}}{3}\right ) \cosh \left (d x +c \right )+b \left (\frac {\sinh \left (d x +c \right )^{4}}{3 \cosh \left (d x +c \right )}-\frac {4 \sinh \left (d x +c \right )^{2}}{3 \cosh \left (d x +c \right )}-\frac {8}{3 \cosh \left (d x +c \right )}\right )}{d}\) \(75\)
default \(\frac {a \left (-\frac {2}{3}+\frac {\sinh \left (d x +c \right )^{2}}{3}\right ) \cosh \left (d x +c \right )+b \left (\frac {\sinh \left (d x +c \right )^{4}}{3 \cosh \left (d x +c \right )}-\frac {4 \sinh \left (d x +c \right )^{2}}{3 \cosh \left (d x +c \right )}-\frac {8}{3 \cosh \left (d x +c \right )}\right )}{d}\) \(75\)
risch \(\frac {{\mathrm e}^{3 d x +3 c} a}{24 d}+\frac {{\mathrm e}^{3 d x +3 c} b}{24 d}-\frac {3 \,{\mathrm e}^{d x +c} a}{8 d}-\frac {7 \,{\mathrm e}^{d x +c} b}{8 d}-\frac {3 \,{\mathrm e}^{-d x -c} a}{8 d}-\frac {7 \,{\mathrm e}^{-d x -c} b}{8 d}+\frac {{\mathrm e}^{-3 d x -3 c} a}{24 d}+\frac {{\mathrm e}^{-3 d x -3 c} b}{24 d}-\frac {2 b \,{\mathrm e}^{d x +c}}{d \left ({\mathrm e}^{2 d x +2 c}+1\right )}\) \(141\)

[In]

int(sinh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*(-2/3+1/3*sinh(d*x+c)^2)*cosh(d*x+c)+b*(1/3*sinh(d*x+c)^4/cosh(d*x+c)-4/3*sinh(d*x+c)^2/cosh(d*x+c)-8/3
/cosh(d*x+c)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 91 vs. \(2 (45) = 90\).

Time = 0.26 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.94 \[ \int \sinh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {{\left (a + b\right )} \cosh \left (d x + c\right )^{4} + {\left (a + b\right )} \sinh \left (d x + c\right )^{4} - 4 \, {\left (2 \, a + 5 \, b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} \cosh \left (d x + c\right )^{2} - 4 \, a - 10 \, b\right )} \sinh \left (d x + c\right )^{2} - 9 \, a - 45 \, b}{24 \, d \cosh \left (d x + c\right )} \]

[In]

integrate(sinh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

1/24*((a + b)*cosh(d*x + c)^4 + (a + b)*sinh(d*x + c)^4 - 4*(2*a + 5*b)*cosh(d*x + c)^2 + 2*(3*(a + b)*cosh(d*
x + c)^2 - 4*a - 10*b)*sinh(d*x + c)^2 - 9*a - 45*b)/(d*cosh(d*x + c))

Sympy [F]

\[ \int \sinh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\int \left (a + b \tanh ^{2}{\left (c + d x \right )}\right ) \sinh ^{3}{\left (c + d x \right )}\, dx \]

[In]

integrate(sinh(d*x+c)**3*(a+b*tanh(d*x+c)**2),x)

[Out]

Integral((a + b*tanh(c + d*x)**2)*sinh(c + d*x)**3, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 136 vs. \(2 (45) = 90\).

Time = 0.21 (sec) , antiderivative size = 136, normalized size of antiderivative = 2.89 \[ \int \sinh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=-\frac {1}{24} \, b {\left (\frac {21 \, e^{\left (-d x - c\right )} - e^{\left (-3 \, d x - 3 \, c\right )}}{d} + \frac {20 \, e^{\left (-2 \, d x - 2 \, c\right )} + 69 \, e^{\left (-4 \, d x - 4 \, c\right )} - 1}{d {\left (e^{\left (-3 \, d x - 3 \, c\right )} + e^{\left (-5 \, d x - 5 \, c\right )}\right )}}\right )} + \frac {1}{24} \, a {\left (\frac {e^{\left (3 \, d x + 3 \, c\right )}}{d} - \frac {9 \, e^{\left (d x + c\right )}}{d} - \frac {9 \, e^{\left (-d x - c\right )}}{d} + \frac {e^{\left (-3 \, d x - 3 \, c\right )}}{d}\right )} \]

[In]

integrate(sinh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

-1/24*b*((21*e^(-d*x - c) - e^(-3*d*x - 3*c))/d + (20*e^(-2*d*x - 2*c) + 69*e^(-4*d*x - 4*c) - 1)/(d*(e^(-3*d*
x - 3*c) + e^(-5*d*x - 5*c)))) + 1/24*a*(e^(3*d*x + 3*c)/d - 9*e^(d*x + c)/d - 9*e^(-d*x - c)/d + e^(-3*d*x -
3*c)/d)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 105 vs. \(2 (45) = 90\).

Time = 0.32 (sec) , antiderivative size = 105, normalized size of antiderivative = 2.23 \[ \int \sinh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {a {\left (e^{\left (d x + c\right )} + e^{\left (-d x - c\right )}\right )}^{3} + b {\left (e^{\left (d x + c\right )} + e^{\left (-d x - c\right )}\right )}^{3} - 12 \, a {\left (e^{\left (d x + c\right )} + e^{\left (-d x - c\right )}\right )} - 24 \, b {\left (e^{\left (d x + c\right )} + e^{\left (-d x - c\right )}\right )} - \frac {48 \, b}{e^{\left (d x + c\right )} + e^{\left (-d x - c\right )}}}{24 \, d} \]

[In]

integrate(sinh(d*x+c)^3*(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

1/24*(a*(e^(d*x + c) + e^(-d*x - c))^3 + b*(e^(d*x + c) + e^(-d*x - c))^3 - 12*a*(e^(d*x + c) + e^(-d*x - c))
- 24*b*(e^(d*x + c) + e^(-d*x - c)) - 48*b/(e^(d*x + c) + e^(-d*x - c)))/d

Mupad [B] (verification not implemented)

Time = 1.84 (sec) , antiderivative size = 99, normalized size of antiderivative = 2.11 \[ \int \sinh ^3(c+d x) \left (a+b \tanh ^2(c+d x)\right ) \, dx=\frac {{\mathrm {e}}^{-3\,c-3\,d\,x}\,\left (a+b\right )}{24\,d}+\frac {{\mathrm {e}}^{3\,c+3\,d\,x}\,\left (a+b\right )}{24\,d}-\frac {{\mathrm {e}}^{c+d\,x}\,\left (3\,a+7\,b\right )}{8\,d}-\frac {{\mathrm {e}}^{-c-d\,x}\,\left (3\,a+7\,b\right )}{8\,d}-\frac {2\,b\,{\mathrm {e}}^{c+d\,x}}{d\,\left ({\mathrm {e}}^{2\,c+2\,d\,x}+1\right )} \]

[In]

int(sinh(c + d*x)^3*(a + b*tanh(c + d*x)^2),x)

[Out]

(exp(- 3*c - 3*d*x)*(a + b))/(24*d) + (exp(3*c + 3*d*x)*(a + b))/(24*d) - (exp(c + d*x)*(3*a + 7*b))/(8*d) - (
exp(- c - d*x)*(3*a + 7*b))/(8*d) - (2*b*exp(c + d*x))/(d*(exp(2*c + 2*d*x) + 1))